/**
 * 
 */
package com.ms.service.module.baccarat.db;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ms.service.module.baccarat.bin.BacrTableSettingInfo;
import com.xpec.c4.db.model.basic.BasicGameModel;

/**
 * 百家樂機台資料
 * 
 * @author TW15010
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = "bacr_machine")
@org.hibernate.annotations.Table(
		appliesTo = "bacr_machine", indexes = {
				@org.hibernate.annotations.Index(name = "IDX_HALLTYPE", columnNames = { "halltype"}),
		}
)
public class BacrMachineDataModel extends BasicGameModel implements Cloneable {
	private static final long serialVersionUID = -7090091822491213424L;

	/**
	 * 館別 <br>
	 * {@link BacrTableSettingInfo#getTableId()}
	 **/
	private String halltype;

	/**
	 * 機台座位號碼
	 **/
	private int machineid;

	/**
	 * 局號
	 */
	private String roundNumber;

	/**
	 * 累計靴數
	 */
	private int curShoeCount;

	/**
	 * 目前是第幾鋪牌
	 */
	private int curHandCount;

	/**
	 * 牌靴
	 */
	private String cardShoe;

	/**
	 * 一靴牌期間的勝負記錄
	 */
	private String gameRecordList;

	/**
	 * 總押注
	 **/
	private BigDecimal totalbet;

	/**
	 * 總支出
	 **/
	private BigDecimal payout;

	/**
	 * 總靴數
	 */
	private int shoeCount;

	/**
	 * 總牌局數
	 */
	private int handCount;

	/**
	 * 機台歷史總押注
	 **/
	private BigDecimal allbet;

	/**
	 * 機台歷史總支出
	 **/
	private BigDecimal allpayout;

	/**
	 * 機台歷史總靴數
	 */
	private int allShoeCount;

	/**
	 * 機台歷史總牌局數
	 */
	private int allHandCount;

	/**
	 * 資料最後更新時間
	 */
	private Date modify_time;
	
	/**
	 * 機台總活動得分支出
	 */
	private BigDecimal totalActivityPayOut;
	
	/**
	 * 機台歷史總活動得分支出
	 */
	private BigDecimal allActivityPayOut;

	/**
	 * 複製一份自己
	 */
	public BacrMachineDataModel clone() throws CloneNotSupportedException {
		return (BacrMachineDataModel) super.clone();
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(nullable = false)
	public Date getModify_time() {
		return modify_time;
	}

	public void setModify_time(Date modify_time) {
		this.modify_time = modify_time;
	}

	public String getHalltype() {
		return halltype;
	}

	public void setHalltype(String halltype) {
		this.halltype = halltype;
	}

	public int getMachineid() {
		return machineid;
	}

	public void setMachineid(int machineid) {
		this.machineid = machineid;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getTotalbet() {
		return totalbet;
	}

	public void setTotalbet(BigDecimal totalbet) {
		this.totalbet = totalbet;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getPayout() {
		return payout;
	}

	public void setPayout(BigDecimal payout) {
		this.payout = payout;
	}

	public int getShoeCount() {
		return shoeCount;
	}

	public void setShoeCount(int shoeCount) {
		this.shoeCount = shoeCount;
	}

	public int getHandCount() {
		return handCount;
	}

	public void setHandCount(int handCount) {
		this.handCount = handCount;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getAllbet() {
		return allbet;
	}

	public void setAllbet(BigDecimal allbet) {
		this.allbet = allbet;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getAllpayout() {
		return allpayout;
	}

	public void setAllpayout(BigDecimal allpayout) {
		this.allpayout = allpayout;
	}

	public int getAllShoeCount() {
		return allShoeCount;
	}

	public void setAllShoeCount(int allShoeCount) {
		this.allShoeCount = allShoeCount;
	}

	public int getAllHandCount() {
		return allHandCount;
	}

	public void setAllHandCount(int allHandCount) {
		this.allHandCount = allHandCount;
	}

	public String getRoundNumber() {
		return roundNumber;
	}

	public void setRoundNumber(String roundNumber) {
		this.roundNumber = roundNumber;
	}

	public int getCurShoeCount() {
		return curShoeCount;
	}

	public void setCurShoeCount(int curShoeCount) {
		this.curShoeCount = curShoeCount;
	}

	public int getCurHandCount() {
		return curHandCount;
	}

	public void setCurHandCount(int curHandCount) {
		this.curHandCount = curHandCount;
	}

	/**
	 * 一副牌 54 張, 一張牌的 log "101," 長度為 4<br>
	 * 30副牌, 54*4*30=6480<br>
	 */
	@Column(columnDefinition = "VARCHAR(7000) default ''")
	public String getCardShoe() {
		return cardShoe;
	}

	public void setCardShoe(String cardShoe) {
		this.cardShoe = cardShoe;
	}

	/**
	 * 一副牌 54 張, 假設最大利用限度 4 張一舖牌, 可以玩 54/4=13 鋪<br>
	 * 30副牌, 30*13=390 鋪<br>
	 * 一舖牌的歷史記錄 log "4|1|0," 長度為 6 字元<br>
	 * 總共就是 6*390=2340
	 */
	@Column(columnDefinition = "VARCHAR(3000) default ''")
	public String getGameRecordList() {
		return gameRecordList;
	}

	public void setGameRecordList(String gameRecordList) {
		this.gameRecordList = gameRecordList;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getTotalActivityPayOut() {
		return totalActivityPayOut;
	}

	public void setTotalActivityPayOut(BigDecimal totalActivityPayOut) {
		this.totalActivityPayOut = totalActivityPayOut;
	}

	@Column(precision = 19, scale = 2, columnDefinition = "DECIMAL(19,2) default 0.0")
	public BigDecimal getAllActivityPayOut() {
		return allActivityPayOut;
	}

	public void setAllActivityPayOut(BigDecimal allActivityPayOut) {
		this.allActivityPayOut = allActivityPayOut;
	}
}
